﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class paint : MonoBehaviour
{
    Vector3 pos;
    Vector3 posend;
    // Start is called before the first frame update
    void Start()
    {
     var cam=   this.GetComponent<Camera>();
        posend = cam.transform.position;
        pos = cam.transform.position - cam.transform.forward * 8;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    float campos;
    private void OnGUI()
    {
        GUILayout.Label("camera dist");
        campos = GUILayout.HorizontalSlider(campos, 0, 100.0f,GUILayout.Width(200));
        transform.position = Vector3.Lerp(pos, posend, campos/100.0f);
    }
}
